package com.jinsi.service.tang.iml;

import com.jinsi.constant.TangConstant;
import com.jinsi.mapper.tang.OperationLogSMapper;
import com.jinsi.pojo.Journal;
import com.jinsi.service.tang.OperationLogSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 操作日志列表
 * @author 唐文博
 * @Date 2022-08-24
 */
@Service
@Transactional
public class OperationLogSServiceImpl implements OperationLogSService {
    @Autowired
    private OperationLogSMapper operationLogMapper;

    /**
     * 查看表，全查 模糊查
     * @param journalName
     * @param journalOperationList
     * @param journalOperation
     * @param timeTable
     * @return
     */
    @Override
    @Transactional(readOnly = true)
    public List<Journal> getOperationLog(String journalName, String journalOperationList,
                                         String journalOperation, String timeTable) {
        return operationLogMapper.getOperationLog(journalName,journalOperationList,
                journalOperation,timeTable, TangConstant.COMMODITY_ISDEL);
    }

    /**
     * 假删除 商品删除
     * @param journalId
     * @return
     */
    @Override
    public int deleteOperationLog(Integer journalId) {
        return operationLogMapper.deleteOperationLog(journalId,TangConstant.COMMODITY_ISDELETE);
    }
}
